package com.ltsw.mvpbaseproject;

import android.widget.Toast;

import com.ltsw.mvpbaseproject.baseBean.HttpData;
import com.ltsw.mvpbaseproject.baseJson.MyJsonCallBack;
import com.ltsw.mvpbaseproject.basePresenter.BasePresenter;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.lzy.okgo.request.GetRequest;

/**
 * @author FangHeQiang
 * @description:
 * @date :2019/8/28 15:16
 */
public class MainPresenter extends BasePresenter<MainActivity> {

    // 测试网络接口
    public void getLogin(String phone, String pwd) {
        OkGo.<HttpData<Object>>get("http://hygj.hrxjk.com:9999/doctor/doctor/doctorLogin/")
                .params("doctorPhone", phone)
                .params("doctorPassWord", pwd)
                .execute(new MyJsonCallBack<HttpData<Object>>(this, true) {
                    @Override
                    protected void _onSuccess(Response<HttpData<Object>> response) {
                        Toast.makeText(mContext, "接口请求成功", Toast.LENGTH_LONG).show();

                    }
                });
    }

}
